import { QwikAuth$ } from "@auth/qwik";
import { D1Adapter } from "@auth/d1-adapter";
import GitHub from "@auth/qwik/providers/github";
import Google from "@auth/qwik/providers/google";

export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
  ({ platform }) => ({
		secret: platform.env['AUTH_SECRET'],
    providers: [GitHub, Google],
		adapter: D1Adapter(platform.env['D1DATA']),
  }),
);
